package com.qiaoanju.service.impl;

import com.qiaoanju.domain.UserDomain;
import com.qiaoanju.service.UserService;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    /**
     * @param id
     * @return
     */
    @Override
    public UserDomain findOne(Long id) {
        return new UserDomain("test","provider");
    }

    /**
     * @param user
     * @return
     */
    @Override
    public UserDomain postUser(UserDomain user) {
        user.setId(123L);
        return user;
    }

    /**
     * @param map
     * @return
     */
    @Override
    public UserDomain checkUser(Map<String, Object> map) {
        UserDomain user = new UserDomain((String)map.get("username"),(String)map.get("password"));
        user.setId(123L);
        return user;
    }
}
